{
    let oNav = document.querySelector('.left-nav')
    let oDel = document.querySelector('.del')
    // console.log(oNav,oDel)
    oDel.onclick = function(){
        oNav.style.display = 'none'
    }
}  

let oList =document.querySelector('.list')
console.log(oList)
function getDate(index,txt){
    ajax({
        url:'http://192.168.10.28:8080/qfBlog/getAll',
        type:'get',
        data:{
            // txt:txt
        },
        success(res){
            let json = JSON.parse(res)
            console.log(json)
            json.data.forEach(ele => {
                    oList.innerHTML +=`<li goods_id="${ele.id}">
                    <a href="javascript:;" class="link">${ele.title}</a>
                    <a href="javascript:;" class="link2">
                        <p>${ele.content}</p>
                    </a>
                    <div class="list-foot">
                        <span>
                            <a href="javascript:;">
                                <img src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLzJ98DReewRSpJTAK6Y7e11YxpzVa1gBXm47TlqFibbJR2lllvBmkNsNvcdYJnsJ6nKhjMEu9DSibg/132" alt="">
                                <span>${ele.username}</span>
                            </a>
                        </span>
                        <span>
                            <label>时间:</label>
                            <span>${ele.gmt_create}</span>
                        </span>
                        <span>
                            <label>浏览:</label>
                            <span>${ele.views}</span>
                        </span>
                        <span>
                            <label for="">分类:</label>
                            <a href="javascript:;" >${ele.category}</a>
                        </span>
                    </div>
                </li>`
            })
            let aLi= document.querySelectorAll('.list li')
            // console.log(aLi)
            // let shopArr =[]
            aLi.forEach(ele =>{
                ele.onclick =function(e){
                    let id = this.getAttribute('goods_id')
                    // shopArr.push(id)
                // console.log(shopArr)
                // console.log(id)
                localStorage.setItem('id', id)
                location.href = 'http://127.0.0.1:5500/joint-project/project/detail/html/lakedetail.html'
                }
            })
        }
    })    
}
getDate()

function fn(count){
    new Pagination('.pagination',{
        strClass:'first, prev, list, next, last, go, total',
        total: count,
        limit:15,
        num: 1,
        callback(index,limit) {
            console.log(111)
            getData(index, '',limit)
        }
    })
}
let aA =document.querySelectorAll('.column ul li a')
console.log(aA)
aA.forEach(ele=>{
    ele.onclic =function(){
        getDate(1,ele.innerHTML)
    }
})
